<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <title>text</title>
  <!-- 引入Vue -->
  <script type="text/javascript" src="../js/vue.js"></script>
</head>

<body>
  <!-- 准备好一个容器-->
  <div id="demo">
    <a @click.prevent.stop="showClick" href="http://baidu.com">点击去打游戏</a>
    <a @click.prevent.stop="showClick" href="https://www.baidu.com">点我</a>
    <hr>
    <a @click.once="showClick" href="http://baidu.com">点击去打游戏</a>
    <hr>
    <form action="http://baidu.com">
      <button @click.prevent="showClick">提交</button>
    </form>
  </div>

</body>

<script type="text/javascript">
  // 创建实例
  const vm = new Vue({
    el: '#demo',
    methods: {
      showClick(e) {
        console.log('click');
      }
    }
  })

</script>

</html>